package com.tbit.uqbike.object.pojo.vo;

import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.tbit.uqbike.annos.Excel;
import lombok.Data;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDateTime;

/**
 * 邀请记录明细视图
 *
 * @author <a href="mailto:zhang.zhiliang@tbit.com.cn">Zhang ZhiLiang</a>
 * @version 1.0
 * @see <a href="http://adsl1.tbit.com.cn:21490/pages/viewpage.action?pageId=82182491">订单号规范</a>
 * @since 2025/2/27
 */
@Data
public class InviteLogVO {
    /**活动编号*/
    @Excel(name = "活动编号",sort = 1)
    private Integer eventId;
    /**邀请人手机号*/
    @Excel(name = "邀请人手机号",sort = 2)
    private String inviterPhone;
    /**邀请人昵称*/
    @Excel(name = "邀请人昵称",sort = 3)
    private String inviterName;
    /**受邀人手机号*/
    @Excel(name = "受邀人手机号",sort = 4)
    private String inviteesPhone;
    /**受邀人昵称*/
    @Excel(name = "受邀人昵称",sort = 5)
    private String inviteesName;
    /**受邀人注册时间*/
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "受邀人注册时间",dateFormat = "yyyy-MM-dd HH:mm:ss",sort = 6)
    private LocalDateTime registerTime;
    /**受邀人首次骑行时间*/
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "受邀人首骑时间",dateFormat = "yyyy-MM-dd HH:mm:ss",sort = 7)
    private LocalDateTime firstRideTime;
    /**首次骑行订单号*/
    @Excel(name = "首骑订单编号",sort = 8)
    private String rideOrderNO;
    /**首次骑行订单金额*/
    @JsonIgnore
    private Integer rideMoney;
    private String rideMoneyStr;
    /**备注*/
    private String remark;

    /**
     * 格式化返回数据
     */
    public void format(){
        rideMoneyStr = new BigDecimal(rideMoney).divide(new BigDecimal(100), 2,RoundingMode.HALF_UP).toString();
    }
}
